﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using OA.Web.Controllers;

namespace OA.Web.Attribute
{
    public class SiteInfoAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            var controller = context.Controller as BaseController;
            if (controller != null)
            {
                controller.ViewBag.BaseConfig = controller.BaseConfig;
                controller.ViewBag.OssConfig = controller.OssConfig;
                controller.ViewBag.OssUrl = controller.BaseConfig.OssUrl; 
            }
            base.OnActionExecuting(context);
        }
    }
}
